package com.diaohw.platform.framework.web.util;

import eu.bitwalker.useragentutils.UserAgent;
import jakarta.servlet.http.HttpServletRequest;

public class UserAgentUtil {

    public static final String USER_AGENT = "User-Agent";

    public static String browser() {
        HttpServletRequest request = RequestUtil.getRequest();
        UserAgent userAgent = UserAgent.parseUserAgentString(request.getHeader(USER_AGENT));
//        //获取操作系统
//        String osName = userAgent.getOperatingSystem().getName();
        //获取浏览器类型
        return userAgent.getBrowser().getName();

    }

}
